package com.zhangjie.demo.entity;

import lombok.Data;

import java.io.Serializable;
/**
 * @Author: ZhangJie
 * @Description: 封装结果类
 * @DateTime: 2023/7/2
 */
@Data
public class Result<T> implements Serializable {
    private Boolean success;
    private Integer count;
    private T data;

    public static Result ok() {
        Result result = new Result();
        result.setSuccess(true);
        return result;
    }


    public static <T> Result ok(Integer count, T data) {
        Result result = new Result();
        result.setSuccess(true);
        result.setCount(count);
        result.setData(data);
        return result;
    }

}